<!doctype html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>






<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="iOS,Appstore," />





  <link rel="alternate" href="/atom.xml" title="我是一颗小小的石头" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="记得那一年的春天，到那年的夏天，每天把肚子填满，就去撸Objective-C的代码，撸到大汗淋漓，撸到天昏地暗">
<meta name="keywords" content="iOS,Appstore">
<meta property="og:type" content="article">
<meta property="og:title" content="App上AppStore需求">
<meta property="og:url" content="http://rocksky.me/2016/09/10/2016-09-10appstoredemand/index.html">
<meta property="og:site_name" content="我是一颗小小的石头">
<meta property="og:description" content="记得那一年的春天，到那年的夏天，每天把肚子填满，就去撸Objective-C的代码，撸到大汗淋漓，撸到天昏地暗">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2017-09-13T03:55:13.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="App上AppStore需求">
<meta name="twitter:description" content="记得那一年的春天，到那年的夏天，每天把肚子填满，就去撸Objective-C的代码，撸到大汗淋漓，撸到天昏地暗">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"always","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: 'B3Z9QGBKUY',
      apiKey: '3e128e47b1d944db2bc5aea5bd932897',
      indexName: 'rockblog',
      hits: {"per_page":10},
      labels: {"input_placeholder":"请输入关键字","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://rocksky.me/2016/09/10/2016-09-10appstoredemand/"/>





  <title>App上AppStore需求 | 我是一颗小小的石头</title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  














  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    <script>
	(function(){
		if(''){
			if (prompt('请输入小石头给你的密码，没有的话找小石头要','') !== ''){
				alert('恭喜你答错啦！');
				history.back();
			}
		}
	})();
    </script>

    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">我是一颗小小的石头</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-commonweal">
          <a href="/404.html" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-heartbeat"></i> <br />
            
            公益404
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  
  <div class="algolia-popup popup search-popup">
    <div class="algolia-search">
      <div class="algolia-search-input-icon">
        <i class="fa fa-search"></i>
      </div>
      <div class="algolia-search-input" id="algolia-search-input"></div>
    </div>

    <div class="algolia-results">
      <div id="algolia-stats"></div>
      <div id="algolia-hits"></div>
      <div id="algolia-pagination" class="algolia-pagination"></div>
    </div>

    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
  </div>




    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://rocksky.me/2016/09/10/2016-09-10appstoredemand/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="SKY">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="我是一颗小小的石头">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">App上AppStore需求</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2016-09-10T15:22:52+08:00">
                2016-09-10
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/iOSAppstore/" itemprop="url" rel="index">
                    <span itemprop="name">iOSAppstore</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a class="cloud-tie-join-count" href="/2016/09/10/2016-09-10appstoredemand/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count join-count" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          
             <span id="/2016/09/10/2016-09-10appstoredemand/" class="leancloud_visitors" data-flag-title="App上AppStore需求">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读次数 </span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>记得那一年的春天，到那年的夏天，每天把肚子填满，就去撸Objective-C的代码，撸到大汗淋漓，撸到天昏地暗<br><a id="more"></a></p>
<h3 id="本篇主要介绍下上Appstore需要准备的一些资料"><a href="#本篇主要介绍下上Appstore需要准备的一些资料" class="headerlink" title="本篇主要介绍下上Appstore需要准备的一些资料"></a>本篇主要介绍下上Appstore需要准备的一些资料</h3><ul>
<li>首先需要一个99$的开发者账号，类型可以是公司的或个人的</li>
<li>证书配置：需要两个根证书，有推送的话还需要两个推送证书，三个配置文件（一个测试，一个发布，一个商店），详细配置请看<a href="http://www.jianshu.com/p/01224fc523d4" target="_blank" rel="external">这里</a></li>
<li><p>启动图size 只适配iPhone 竖屏<br>640x1136  （Retina 4）<br>750x1334 （4.7）<br>1242x2208（5.5）</p>
</li>
<li><p>logo尺寸 只适配iPhone<br>40x40<br>58x58<br>60x60<br>80x80<br>87x87<br>120x120<br>180x180</p>
</li>
<li><p>提交appstore时，查看是否使用了广告标识符</p>
</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">1、打开终端cd到要检查的文件的根目录。</div><div class="line">2、执行下列语句：grep -r advertisingIdentifier .   （别少了最后那个点号）</div><div class="line">3、若包含，则会输出Binary …..的字眼，勾选广告标识</div></pre></td></tr></table></figure>
<h3 id="这里贴一些本人认为不错常用的三方库"><a href="#这里贴一些本人认为不错常用的三方库" class="headerlink" title="这里贴一些本人认为不错常用的三方库"></a>这里贴一些本人认为不错常用的三方库</h3><ul>
<li>Masonry 一个UI适配的三方库 <a href="https://github.com/SnapKit/Masonry" target="_blank" rel="external">源码点这里</a></li>
<li>lottie-ios 一个牛X的动画三方库 <a href="https://github.com/airbnb/lottie-ios" target="_blank" rel="external">源码点这里</a></li>
<li>FMDB 一个便于数据库操作的三方库 <a href="https://github.com/ccgus/fmdb" target="_blank" rel="external">源码点这里</a></li>
<li>IQKeyboardManager 一个处理键盘和输入框的三方库 <a href="https://github.com/hackiftekhar/IQKeyboardManager" target="_blank" rel="external">源码点这里</a></li>
<li>AFNetworking 一个数据请求的三方库 <a href="https://github.com/AFNetworking/AFNetworking" target="_blank" rel="external">源码点这里</a></li>
<li>MJRefresh 一个列表刷新的三方库 <a href="https://github.com/CoderMJLee/MJRefresh" target="_blank" rel="external">源码点这里</a></li>
<li>MJExtension 一个Json解析的三方库 <a href="https://github.com/CoderMJLee/MJExtension" target="_blank" rel="external">源码点这里</a></li>
<li>MBProgressHUD 一个信息提示的三方库 <a href="https://github.com/jdg/MBProgressHUD" target="_blank" rel="external">源码点这里</a></li>
<li>SDWebImage 一个处理网络图片的三方库 <a href="https://github.com/rs/SDWebImage" target="_blank" rel="external">源码点这里</a></li>
<li>NJKWebViewProgress 一个webview请求进度的三方库 <a href="https://github.com/ninjinkun/NJKWebViewProgress" target="_blank" rel="external">源码点这里</a></li>
<li>Aspects 一个黑魔法的三方库 <a href="https://github.com/steipete/Aspects" target="_blank" rel="external">源码点这里</a></li>
<li>SAMKeychain 一个存储用户敏感信息的三方库 <a href="https://github.com/soffes/SAMKeychain" target="_blank" rel="external">源码点这里</a></li>
<li>SDCycleScrollView 一个轮播图的三方库 <a href="https://github.com/gsdios/SDCycleScrollView" target="_blank" rel="external">源码点这里</a></li>
<li>MMDrawerController 一个侧滑抽屉的三方库 <a href="https://github.com/mutualmobile/MMDrawerController" target="_blank" rel="external">源码点这里</a></li>
<li>FDFullscreenPopGesture 一个支持全屏滑动返回的三方库 <a href="https://github.com/forkingdog/FDFullscreenPopGesture" target="_blank" rel="external">源码点这里</a></li>
<li>JPush 一个UI适配的三方库 <a href="https://github.com/wisdomslab/JPush" target="_blank" rel="external">源码点这里</a></li>
<li>PYSearch 一个搜索的三方库 <a href="https://github.com/iphone5solo/PYSearch" target="_blank" rel="external">源码点这里</a></li>
<li>GPUImage 一个图片处理的三方库 <a href="">源码点这里</a></li>
</ul>
<h3 id="比较不错的技术文档"><a href="#比较不错的技术文档" class="headerlink" title="比较不错的技术文档"></a>比较不错的技术文档</h3><ul>
<li>git常用命令 <a href="http://www.ruanyifeng.com/blog/2015/12/git-cheat-sheet.html" target="_blank" rel="external">点这里</a></li>
<li>正则表达式 <a href="http://www.admin10000.com/document/5944.html" target="_blank" rel="external">点这里</a></li>
<li>Masonry使用 <a href="http://www.jianshu.com/p/2b57ece2b3b8" target="_blank" rel="external">点这里</a></li>
<li>邓白氏码申请 <a href="http://www.cnblogs.com/zhangying-domy/p/5091759.html" target="_blank" rel="external">点这里</a></li>
<li>喵大神的博客 <a href="https://onevcat.com" target="_blank" rel="external">点这里</a></li>
<li>源码解读 <a href="http://www.cocoachina.com/cms/tags.php?/源码/" target="_blank" rel="external">点这里</a></li>
<li>旋转引导页 <a href="http://www.jianshu.com/p/1b470fd15470" target="_blank" rel="external">点这里</a></li>
<li>git常用命令 <a href="http://www.ruanyifeng.com/blog/2015/12/git-cheat-sheet.html" target="_blank" rel="external">点这里</a></li>
<li>git常用命令 <a href="http://www.ruanyifeng.com/blog/2015/12/git-cheat-sheet.html" target="_blank" rel="external">点这里</a></li>
<li>git常用命令 <a href="http://www.ruanyifeng.com/blog/2015/12/git-cheat-sheet.html" target="_blank" rel="external">点这里</a></li>
<li>git常用命令 <a href="http://www.ruanyifeng.com/blog/2015/12/git-cheat-sheet.html" target="_blank" rel="external">点这里</a></li>
</ul>
<h3 id="下面罗列了一些我的开源项目，喜欢的别忘了给颗star"><a href="#下面罗列了一些我的开源项目，喜欢的别忘了给颗star" class="headerlink" title="下面罗列了一些我的开源项目，喜欢的别忘了给颗star"></a>下面罗列了一些我的开源项目，喜欢的别忘了给颗star</h3><ul>
<li>SKYTools 一个自己项目中常用的小工具/分类等等的开源库 <a href="https://github.com/skyrock90/SKYTools" target="_blank" rel="external">源码点这里</a></li>
<li>Masonry 一个UI适配的三方库 <a href="">源码点这里</a></li>
<li>Masonry 一个UI适配的三方库 <a href="">源码点这里</a></li>
<li>Masonry 一个UI适配的三方库 <a href="">源码点这里</a></li>
</ul>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/iOS/" rel="tag"># iOS</a>
          
            <a href="/tags/Appstore/" rel="tag"># Appstore</a>
          
        </div>
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2016/08/15/2016-08-15iosnormalproblem/" rel="next" title="iOS App常用配置">
                <i class="fa fa-chevron-left"></i> iOS App常用配置
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2016/10/02/2016-10-02appstoreregect/" rel="prev" title="AppStore被拒汇总">
                AppStore被拒汇总 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
  <a class="jiathis_button_tsina"></a>
  <a class="jiathis_button_tqq"></a>
  <a class="jiathis_button_weixin"></a>
  <a class="jiathis_button_cqq"></a>
  <a class="jiathis_button_douban"></a>
  <a class="jiathis_button_renren"></a>
  <a class="jiathis_button_qzone"></a>
  <a class="jiathis_button_kaixin001"></a>
  <a class="jiathis_button_copy"></a>
  <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank"></a>
  <a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" >
  var jiathis_config={
    hideMore:false
  }
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->

      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.jpg"
               alt="SKY" />
          <p class="site-author-name" itemprop="name">SKY</p>
           
              <p class="site-description motion-element" itemprop="description">SKY | iOS | develop | 移动</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">12</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">9</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">9</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/skyrock90" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/u/3124928107?is_all=1" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  Weibo
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#本篇主要介绍下上Appstore需要准备的一些资料"><span class="nav-number">1.</span> <span class="nav-text">本篇主要介绍下上Appstore需要准备的一些资料</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#这里贴一些本人认为不错常用的三方库"><span class="nav-number">2.</span> <span class="nav-text">这里贴一些本人认为不错常用的三方库</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#比较不错的技术文档"><span class="nav-number">3.</span> <span class="nav-text">比较不错的技术文档</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#下面罗列了一些我的开源项目，喜欢的别忘了给颗star"><span class="nav-number">4.</span> <span class="nav-text">下面罗列了一些我的开源项目，喜欢的别忘了给颗star</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2016 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">SKY</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>

  
  <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.1"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  
    
    <script>
      var cloudTieConfig = {
        url: document.location.href, 
        sourceId: "",
        productKey: "0e863791628e4ea384c811d1cb509425",
        target: "cloud-tie-wrapper"
      };
    </script>
    <script src="https://img1.ws.126.net/f2e/tie/yun/sdk/loader.js"></script>
  










  




  
  
  
  <link rel="stylesheet" href="/lib/algolia-instant-search/instantsearch.min.css">

  
  
  <script src="/lib/algolia-instant-search/instantsearch.min.js"></script>
  

  <script src="/js/src/algolia-search.js?v=5.1.1"></script>



  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("uMSsGE1N7o7xR0ddmluiyocN-gzGzoHsz", "GQJnywX1H3dn7BuHJB41cmAu");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  

  

</body>
</html>
